/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package se.kth.lwr.jeat.samples.onsitetreatment;

import javax.measure.converter.UnitConverter;
import javax.measure.quantity.Angle;
import javax.measure.quantity.Dimensionless;
import javax.measure.quantity.Energy;
import javax.measure.quantity.Mass;
import javax.measure.quantity.Quantity;
import javax.measure.unit.AlternateUnit;
import javax.measure.unit.BaseUnit;
import javax.measure.unit.DerivedUnit;
import javax.measure.unit.NonSI;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import static javax.measure.unit.SI.*;

/**Utility class to get fast access to common derived units not availible in
 * the javax.measure.unit.Unit package
 *
 * @author davidev
 */
public class Units {

    
    /**
     * The Unit for Person Equivalents (common in wastewater treatment)
     */

    public static final Unit<Dimensionless> PersonEquivalent=new BaseUnit<>("Pe");
    
    
    /**
     * Unit for PO4 eqvivalents
     */
    
    public static final Unit<Dimensionless> PO4Eqvivalent=new BaseUnit<>("PO4 eq");
    
    /**
     * Unit for CO2 eqvivalents
     */
    
    public static final Unit<Dimensionless> CO2Eqvivalent=new BaseUnit<>("CO2 eq");

    
    /**
     * MJ
     */
    public static final Unit<Energy> MEGA_JOULE=SI.MEGA(JOULE);
    /**
     * kg/m3
     */
    public static final Unit KG_PER_CUBIC_METER=KILOGRAM.divide(CUBIC_METRE);
    
    /**
     * kg/L
     */
    public static final Unit KG_PER_LITER=KILOGRAM.divide(NonSI.LITER);
    /**
     * kg/yr
     */
    public static final Unit KG_PER_YEAR=KILOGRAM.divide(NonSI.YEAR);
    /**
     * MJ/kg
     */
    public static final Unit MEGA_JOUL_PER_KG=SI.MEGA(JOULE).divide(KILOGRAM);
    /**
     * Ton (1000 kg)
     */
    public static final Unit<Mass> TON=SI.KILO(KILOGRAM);   
    /*
     * Ton/m3
     */
    public static final Unit<? extends Quantity> TON_PER_CUBIC_METER=TON.divide(CUBIC_METRE);
    
    /**
     * MJ/m3
     */
    public static final Unit<? extends Quantity> MEGA_JOULE_PER_CUBIC_METER=MEGA_JOULE.divide(CUBIC_METRE);
    
    /**
     * MJ/m2
     */
    public static final Unit<? extends Quantity> MEGA_JOULE_PER_SQARE_METER=MEGA_JOULE.divide(SQUARE_METRE);
    
    /**
     * MJ/km
     */
    public static final Unit<? extends Quantity> MEGA_JOULE_PER_KILO_METER=MEGA_JOULE.divide(KILOMETER);
    
    /**
     * MJ/min
     */
    public static final Unit<? extends Quantity> MEGA_JOULE_PER_MINUTE=MEGA_JOULE.divide(NonSI.MINUTE);
    
    /**
     * gram per person and day
     */
    public static final Unit<? extends Quantity> GRAM_PER_PERSON_AND_DAY=SI.GRAM.divide(PersonEquivalent).divide(NonSI.DAY);
}
